package com.intramirror.wd.model.enums;

import java.util.HashMap;
import java.util.Map;

public enum CouponPreConditionEnum {
    NEW(3,"老用户邀请新用户"),
    OLD(2,"指定用户"),
    REGISTER(1,"新用户注册");


    private Integer key;
    private String value;

    CouponPreConditionEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public Integer getKey() {
        return key;
    }

    public void setKey(Integer key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static Map<Integer, String> map;

    static {
        map = new HashMap<>();
        for (CouponPreConditionEnum item : values()) {
            map.put(item.getKey(), item.getValue());
        }
    }

    public static String getValueByKey(int key) {
        return map.get(key);
    }

}
